//
//  GRXTenseTimeCell.m
//  1-MushroomStreet-自定义tabbar
//
//  Created by xmg on 15/12/25.
//  Copyright © 2015年 grx. All rights reserved.
//

#import "GRXTenseTimeCell.h"
#import "GRXLoadDataTool.h"
#import <MJExtension/MJExtension.h>
#import "GRXPromotionItem.h"
#import <UIImageView+WebCache.h>
@interface GRXTenseTimeCell ()

/**右上边的imageView*/
@property (weak, nonatomic) IBOutlet UIImageView *RtopImageView;

/**右下边第一个imageView*/
@property (weak, nonatomic) IBOutlet UIImageView *RFirstImageView;

/**右下边第二个imageView*/
@property (weak, nonatomic) IBOutlet UIImageView *RSecondImageView;

/**限时抢购imageView*/
@property (weak, nonatomic) IBOutlet UIImageView *tenseImageView;

/**限时快抢价格*/
@property (weak, nonatomic) IBOutlet UILabel *tensePriceLabel;

/**小时label*/
@property (weak, nonatomic) IBOutlet UILabel *hourLabel;

/**分钟label*/
@property (weak, nonatomic) IBOutlet UILabel *miniteLabel;
/**秒label*/
@property (weak, nonatomic) IBOutlet UILabel *secondLabel;

//模型数组
@property (nonatomic,strong)NSArray *proItemArray;


@end

@implementation GRXTenseTimeCell

/**
 *数据懒加载
 */
- (NSArray *)proItemArray
{
    if (_proItemArray) {
        _proItemArray = [[NSArray alloc] init];
    }
    return _proItemArray;
}


- (void)awakeFromNib{
    
    //加载数据
    [self loadData];
    
}


//加载数据
- (void)loadData{
    [GRXLoadDataTool loadData:^(NSDictionary *htmlData) {
        //获取图片数据
        NSArray *proItemArray = htmlData[@"promotions"][@"list"];
        self.tensePriceLabel.text = [NSString stringWithFormat:@"快抢价%@",htmlData[@"promotions"][@"itemPrice"]];
        
        //设置数据
        [self.tenseImageView sd_setImageWithURL:[NSURL URLWithString:proItemArray[0][@"img"]]];
        [self.RtopImageView sd_setImageWithURL:[NSURL URLWithString:proItemArray[1][@"img"]]];
        [self.RFirstImageView sd_setImageWithURL:[NSURL URLWithString:proItemArray[2][@"img"]]];
        [self.RSecondImageView sd_setImageWithURL:[NSURL URLWithString:proItemArray[3][@"img"]]];
        
    }];
}



@end
